﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// add
using System.Collections.ObjectModel;

namespace FormBase
{
    public class CListKeyValueString: KeyedCollection<string, CItemKeyValue>
    {
        public CListKeyValueString() : base() { }
        protected override string GetKeyForItem(CItemKeyValue item)
        {
            return item.msKey;
        }
        public override string ToString()
        {
            StringBuilder sb1 = new StringBuilder();
            sb1.Length = 0;
            for (int i = 0; i < this.Count; i++)
                sb1.AppendFormat("{0},{1},", this[i].msKey, this[i].msValue);

            if (sb1.Length > 0)
                sb1.Length = sb1.Length - 1;

            return sb1.ToString();
        }

    }
}
